home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 3 / BBS in a box - Trilogy III.iso / Files / Prog / U-Z / VideoToolBox Folder / VideoToolboxSources / SetMouse.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-02-23  |  1.8 KB  |  57 lines  |  [TEXT/KAHL]

  1. /*
  2. SetMouse.c
  3. 2/25/91 dgp
  4.  
  5. From "Code gadgets: Setting the mouse location", THINKin' CaP, 1(2):28-29, Fall 1990
  6. Copyright © 1991 SPLAsh Resources. All rights reserved.
  7. ** Restrictions **
  8.  
  9. This source code is copyrighted, but free. This means that programmers may use the code
  10. and incorporate it into their own programs (commercial or otherwise)
  11. without payment of any fees. However, the source code itself may not
  12. be sold or distributed on electronic bulletin board services without
  13. written permission from SPLAsh Resources.
  14.  
  15. SPLAsh Resources
  16. 1678 Shattuck Ave #302
  17. Berkeley, CA  94709
  18. (415) 527-0122
  19.  
  20.  *    Setting the mouse location
  21.  *        Move the mouse location to the given location, which is specified in the
  22.  *        local coordinate system of the current port
  23.  *
  24.  *        WARNING: In the Q & A Stack, Apple tells you how to do this, but warns
  25.  *            that the technique uses undocumented low-memory locations that are
  26.  *            considered unsupported and volatile and may change in future CPUs
  27.  
  28. HISTORY:
  29. 8/24/91    dgp    Made compatible with THINK C 5.0.
  30. */
  31. #include "VideoToolbox.h"
  32.  
  33. #if THINK_C==1    /* old version */
  34.     extern    Point    MTemp        :    0x828;        /* Low memory globals */
  35.     extern    Point    RawMouse    :    0x82C;
  36.     extern    Byte    CrsrNew        :    0x8CE;
  37.     extern    Byte    CrsrCouple    :    0x8CF;
  38. #else
  39.     #include <SysEqu.h>
  40.     #define MTemp (*(Point *)MTemp)
  41.     #define RawMouse (*(Point *)RawMouse)
  42.     #define CrsrNew (*(Byte *)CrsrNew)
  43.     #define CrsrCouple (*(Byte *)CrsrCouple)
  44. #endif
  45.  
  46. void SetMouse(Point    mouseLoc)
  47. {
  48.     LocalToGlobal(&mouseLoc);                /* Convert point to global coordinates    */
  49.     
  50.         /* Quoting from the Q & A Stack: "If you wish to place the cursor in an    */
  51.         /* absolute location on the screen, you must set RawMouse, and MTemp to    */
  52.         /* the same value, and set CrsrNew to the same value as CrsrCouple."    */
  53.         
  54.     MTemp=RawMouse=mouseLoc;
  55.     CrsrNew=CrsrCouple;
  56. }
  57.